package com.siwei.mes.common.base;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;
import tk.mybatis.mapper.provider.base.BaseInsertProvider;

/**
 * @author chenmaolin
 * @version 1.0
 * @date 2020/12/5
 * @Description 通用mapper
 */
public interface BaseMapper<T> extends Mapper<T>, MySqlMapper<T> {
    /**
     * 新增返回主键id
     *
     * @param record
     * @return
     */
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @InsertProvider(type = BaseInsertProvider.class, method = "dynamicSQL")
    @Override
    int insertSelective(T record);
}